import request from '@/api/request.js'
// 查询表单详情
export function getRoleDetail(params) {
    return request({
        url: 'wflow/user/role',
        method: 'get',
        params: params,
    })
}

// 更新表单详情
export function getRoleadd(params) {
    return request({
        url: 'wflow/user/role',
        method: 'post',
        data: params
    })
}

// 更新角色表单详情
export function getRoleUpdate(params) {
    return request({
        url: 'wflow/user/role',
        method: 'put',
        data: params
    })
}

// 删除角色
export function getRoleDelete(id) {
    return request({
        url: 'wflow/user/role/' + id,
        method: 'delete'
    })
}

// 人员的详情获取
export function getPeopleDetail(params) {
    return request({
        url: 'wflow/user/rolePerosn',
        method: 'get',
        params: params,
    })
}

// 人员新增表单详情
export function getPeopleAdd(params) {
    return request({
        url: 'wflow/user/rolePerosn',
        method: 'post',
        data: params
    })
}

// 人员删除表单详情
export function getPeopleDelete(params) {
    return request({
        url: 'wflow/user/rolePerosn',
        method: 'delete',
        data: params
    })
}

// 登录画面接口
export function loginPage(param) {
    return request({
        url: 'sys/auth/newLogin',
        method: 'get',
        params: param,
    })
}

// 登录 单点登录
export function getUserinfo(code) {
    return request({
        url: `/sys/auth/userinfo/${code}`,
        method: 'get',
    })
}


// 菜单的详情获取
export function getMenuseDetail(params) {
    return request({
        url: 'wflow/role/menus',
        method: 'get',
        params: params,
    })
}

// 菜单新增表单详情
export function getMenusAdd(params) {
    return request({
        url: 'wflow/role/menus',
        method: 'post',
        data: params
    })
}

// 菜单删除表单详情
export function getMenusDelete(params) {
    return request({
        url: 'wflow/role/menus',
        method: 'delete',
        data: params
    })
}

export default {
    getRoleDetail,
    getRoleUpdate,
    getRoleDelete,
    getRoleadd,
    getPeopleDetail,
    getPeopleAdd,
    getPeopleDelete,
    loginPage,
    getUserinfo,
    getMenuseDetail,
    getMenusAdd,
    getMenusDelete
}
